import { useIntersectionObserver } from '@vueuse/core'
export const lazyPlugin = {
    install(app){

        app.directive('img-lazy',{
            mounted(el,bind){
        
                 const {stop} = useIntersectionObserver( 
                    el,  
                    ([{ isIntersecting }]) => {
                        console.log(isIntersecting);
                        if(isIntersecting){
                            el.src = bind.value;
                            stop();
                        }
        
                    }, 
                  )
        
        
            }
        })

    }
}